package charnac.model.first;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.LinkedHashSet;

public class BeanFactory {
	public static Person createPerson() {
		Person thePerson = new Person();
		thePerson.setAge(34);

		SimpleDateFormat theFormat = new SimpleDateFormat("dd/MM/yyyy");
		try {
			thePerson.setBirhtDate(theFormat.parse("04/10/1978"));
		} catch (ParseException e) {
		}

		thePerson.setFirstCharName('G');
		thePerson.setHairs(6870033L);
		thePerson.setIncome(5768.98F);
		thePerson.setIndicators((byte) 0xA);
		thePerson.setName("Guy");
		thePerson.setWeight(76);

		thePerson.setChildren(new LinkedHashSet<Person>());
		Person theChild = new Person();
		theChild.setName("Matteo");
		thePerson.getChildren().add(theChild);
		theChild = new Person();
		theChild.setName("Nora");
		thePerson.getChildren().add(theChild);

		Address theAddress = new Address();
		theAddress.setStreet("Frans De Vriendtstraat");
		theAddress.setStreetNumber(27);

		thePerson.setAddress(theAddress);

		return thePerson;

	}
}
